<?php

/**
 * photo actions.
 *
 * @package    sfwixet
 * @subpackage photo
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class profileFriendsComponents extends sfComponents
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
  	try{
  		if($request->getParameter("id")){
  		$profile = Doctrine::getTable("profile")->find($request->getParameter("id"));
  		$mainGroupId = $profile->getUser()->getMainAlbumId();
  		}else throw new Exception("No id provided");
  		
  	}catch(Exception $e){
  		$mainGroupId = $this->getUser()->getGuardUser()->getMainAlbumId();
  	}
  	$q = Doctrine_Query::create()
				->select('a.user_id')
				->from('aclUsersGroups a')
				->where('a.group_id = ?',array($mainGroupId))
				->limit(10);
	$this->friends = $q->execute();

  }
  
  public function executeTitle(sfWebRequest $request)
  {

  }
}
